#ifndef RECT_H
#define RECT_H

#include "Vector2D.h"
#include <tr1/memory>

namespace SolidityEngine {

class Rect;
typedef std::tr1::shared_ptr<Rect> Rect_ptr;

class Rect
{
    float _x,_y,_w,_h;

    public:
        Rect(float left=0.0f, float right=0.0f, float width=1.0f, float height=1.0f);
        virtual ~Rect();

        float& X();
        float X() const;

        float& Y();
        float Y() const;

        float& Width();
        float Width() const;

        float& Height();
        float Height() const;

        void Set(float left, float right, float width, float height);

        Vector2D* GetPoints();
        Vector2D* GetPoints() const;

        ///Get the center point on the screen
        Vector2D GetCentre() const;

        ///Set the location of the surface by adjusting the centre point
        void SetCentre(const Vector2D& point);

        ///Return true if the Rect contains the given point.
        bool Contains(const Vector2D& point) const;

        bool operator==(const Rect& rhs) const;
        bool operator!=(const Rect& rhs) const;

};

};
#endif // RECT_H
